module SandBox
  class Window < Widget
    attr_accessor :title
    
    def initialize title
      super()
      self.style = "width:100%;height:100%"
      @title = title
    end
    
    def content
      render()
    end
        
    def open_js
      "MyDesktop.desktop.createWindow({
          title:'#{@title}',
          width:800,
          height:600,
          html : '#{(CGI.escapeHTML(content.join))}',
          iconCls: 'bogus',
          shim:false,
          animCollapse:false,
          constrainHeader:true,
          layout:'fit'
       }).show()"
    end
  end
end